<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
<link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css?v=${constants.getReleaseVersion()}"/>
<link rel="stylesheet" href="${ctxPath}/assets/expand/css/style.css?v=${constants.getReleaseVersion()}" media="all"/>

<!--可无视-->
<link rel="stylesheet" type="text/css" href="${ctxPath}/assets/common/libs/showStyle/reset.css?v=${constants.getReleaseVersion()}">
<!--响应式框架-->
<link rel="stylesheet" type="text/css" href="${ctxPath}/assets/common/libs/showStyle/bootstrap-grid.min.css" />
<!--图标调用-->
<link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!--主要样式-->
<link rel="stylesheet" type="text/css" href="${ctxPath}/assets/common/libs/showStyle/showStyle.css" />
<style>
    .layui-card-background-lwho{
        background-color: #edf6fd;
        height:154px;
    }
</style>
<body>
<div id="myContiner" style="height: 100%">

    <div class="ui-layout-center">
        <div class="layui-fluid">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-form toolbar">
                                <input id="sformId" class="layui-input" type="hidden" value="1"/>
                                <input id="defaultPassword" class="layui-input" type="hidden" value="${constants.getDefaultPassword()}"/>
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <input id="keyword" class="layui-input" type="text" placeholder="请输入要查询日程表名称"/>
                                    </div>
                                    <div class="layui-inline">
                                        <input id="creatTime" class="layui-input" type="text" placeholder="请输入要查询日程表的创建时间"/>
                                    </div>

                                    <div class="layui-inline">
                                        <button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>

<!--                                        <button id="btnExp" class="layui-btn icon-btn"><i class="layui-icon">&#xe67d;</i>导出</button>-->
                                    </div>
                                </div>
                            </div>


                            <div id="show" style="height: 400px" class="layui-form">


                            </div>

                            <div class="form-group-bottom text-center">

                                <div id="demo7"></div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/baseMethod.js"></script>
@/* 加入contextPath属性和session超时的配置 */
<script type="text/javascript">
    var Feng = {
        ctxPath: "${ctxPath}",
        version: '${constants.getReleaseVersion()}'
    };

</script>

<script>
    layui.use(['jquery','layer', 'form', 'table', 'laydate','laypage',  'tree', 'util'], function () {
        var $=layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var $ax = layui.ax;
        var laydate = layui.laydate;
        var tree = layui.tree;
        var util = layui.util;
        var laypage=layui.laypage;
        var mess={}

        /**
         * 系统管理--用户管理
         */
        var MgrUser = {
            tableId: "userTable",    //表格id
            condition: {
                name: "",
                deptId: "",
                timeLimit: ""
            }
        };


        showdata();
        //分页显示
        function showdata(){
            $.post({
                url:"/myScheduleDraft/showSformDraft",
                data:mess,
                success:function (data) {
                    var  count= data.count;
                    //完整功能
                    laypage.render({
                        elem: 'demo7'
                        ,count:count
                        ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
                        ,limit: 8
                        ,limits: [8,12,16]
                        ,jump: function(obj){
                            mess['page']=obj.curr;//得到当前页，以便向服务端请求对应页的数据。
                            mess['limit']=obj.limit;//得到每页显示的条数
                            $.post({
                                url:"/myScheduleDraft/showSformDraft",
                                data:mess,
                                success:function (data) {
                                    var html=""
                                    var status='checked';
                                    for (var i=0;i<data.data.length;i++) {
                                        if (data.data[i].is_share!='on'){
                                            status='';
                                        }

                                        html+="<!--草稿日程-->\n" +
                                            "<div class=\"layui-col-xs12 layui-col-sm6 layui-col-md3 \" id=\"show-btn\">\n" +
                                            "    <div class=\"layui-card layui-height-lwh\" id=\"show1\">\n" +
                                            "        <div class=\"box layui-card-background-lwho\">\n" +
                                            "            <div class=\"box-content\">\n" +
                                            "                <div class=\"layui-card-header layui-height-lwh-header\">\n" +
                                            "                    <label>创建时间："+data.data[i].creat_time+"</label>\n" +
                                            "                </div>\n" +
                                            "                <div class=\"layui-card-body layui-height-lwh-body\">\n" +
                                            "                    <p class=\"lay-big-font\">"+data.data[i].sform_name+"</p>\n" +
                                            "                    <p>你好空格&nbsp;<span class=\"pull-right\">\n" +
                                            "                                                  <input type=\"checkbox\" name=\"my_schedule_open_1\" lay-filter=\"myfirst_share\"\n" +
                                            "                                                         id='"+data.data[i].sform_id+"' lay-skin='switch' lay-text=\"公开|私有\" "+status+" ></span></p>\n" +
                                            "                </div>\n" +
                                            "                <ul class=\"icon\">\n" +
                                            "                    <li >\n" +
                                            "                        <a  lay-filter='updateBtn' href='javaScript:openRevise("+data.data[i].sform_id+")' > <i class=\"fa fa-magic\"></i></a>\n" +
                                            "                    </li>\n" +
                                            "                    <li>\n" +
                                            "                        <a href='/myScheduleForm/checkScheduleForm?sformId="+data.data[i].sform_id+"'  id='check'><i class=\"fa fa-check\"></i></a>\n" +
                                            "                    </li>\n" +
                                            "                    <li>\n" +
                                            "                        <a  id='combine' href='javaScript:combineSform("+data.data[i].sform_id+")'  ><i class=\"fa fa-legal\"></i></a>\n" +
                                            "                    </li>\n" +
                                            "                    <li>\n" +
                                            "                        <a  id='remove'href='javaScript:isDelete("+data.data[i].sform_id+")' ><i class=\"fa fa-remove\"></i></a>\n" +
                                            "                    </li>\n" +
                                            "                </ul>\n" +
                                            "            </div>\n" +
                                            "        </div>\n" +
                                            "    </div>\n" +
                                            "</div>"
                                    }
                                    $("#show").html(html);
                                    status='checked';
                                    layui.use('form', function() {
                                        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
                                        form.render();

                                    });
                                }
                            });
                        }
                    });
                }
            });
        }


        //点击模糊搜索日程框架
        $("#btnSearch").click(function () {
            var creatTime= $("#creatTime").val();
            var keyword=$("#keyword").val();
            mess['creatTime']=creatTime;
            mess['keyword']=keyword;

            showdata();
        });

        //渲染时间选择框
                laydate.render({
                    elem: '#creatTime',

                });


    });

</script>
</body>

</html>